package com.ssy.lingxi.marketing.model.constant;

import java.util.Arrays;

/**
 * 满量促销类型：1-满量减 2-满量折
 * @author yzc
 * @version 2.0.0
 * @date 2021/9/1
 */
public enum FullQuantityTypeEnum {

    REDUCTION(1, "满量减"),
    DISCOUNT(2, "满量折"),
    ;

    private final Integer code;
    private final String message;

    FullQuantityTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessage(Integer code) {
        return Arrays.stream(FullQuantityTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().map(FullQuantityTypeEnum::getMessage).orElse("");
    }


}
